Hello , i try to find the deleted Abs in object text , i consider that It_1 and It_3 deleted , my code should find It_2 and It_4 .
Skip objList = create // create a skip list to store a list of absolute numbers
Object o
Module m = current
filtering off
string absNum
for o in current Module do {// cycle through all object
if (isDeleted(o)){
accept o
absNum = o."Absolute Number"
put(objList, absNum, o) // store the absolute number for each object in the skip list
}
else
reject o
}
for o in objList do {
attribute "object text" == absNum
print "ID: "o."Absolute Number" " object deleted " "\n"
}
delete objList
i get just It_1 and It_3 als deleted , actually my code should give It_4 and It_2 , have any one idea what is the problem ?
Thx Control17 - Fri Jul 28 03:31:55 EDT 2017 | ||||||||||
Re: find Abs in object text Hello Control17, in this script you mix several concept of DOORS. accept/reject are used for filters, but I think you only want to print a list / create a skip list / give a warning. Additionally, there are some problems in your script (see below), but I wonder if your general approach is good. You are trying to re-program something that DOORS does for you. Why do you not use links, e.g. of type "references" between it_2 and it_1? This way, DOORS would prevent your users from deleting objects that are referenced. The user would then have to adopt the referencing objects before the referenced object can be deleted. And you could create a traceability analysis automatically. And you could reference requirements stored in other modules. Having said that, the problems that I find in your script are:
Regards | ||||||||||
Re: find Abs in object text Mike.Scharnow - Fri Jul 28 04:12:55 EDT 2017 Hello Control17, in this script you mix several concept of DOORS. accept/reject are used for filters, but I think you only want to print a list / create a skip list / give a warning. Additionally, there are some problems in your script (see below), but I wonder if your general approach is good. You are trying to re-program something that DOORS does for you. Why do you not use links, e.g. of type "references" between it_2 and it_1? This way, DOORS would prevent your users from deleting objects that are referenced. The user would then have to adopt the referencing objects before the referenced object can be deleted. And you could create a traceability analysis automatically. And you could reference requirements stored in other modules. Having said that, the problems that I find in your script are:
Regards Hello, Thank u Mike , i do not use links because i allready have a module with deleted object (with out link between Abs and Object text (reference )) , your solution for line 17 that is exactally what i need , i try to do that but i do not know which is the best funciton to find text . is that possible with "findRichText" ? bool findRichText(string s,string sub,int& offset,int& length,bool matchCase)
thank u very much for your support ! Regards, Neven | ||||||||||
Re: find Abs in object text Control17 - Fri Jul 28 05:48:20 EDT 2017 Hello, Thank u Mike , i do not use links because i allready have a module with deleted object (with out link between Abs and Object text (reference )) , your solution for line 17 that is exactally what i need , i try to do that but i do not know which is the best funciton to find text . is that possible with "findRichText" ? bool findRichText(string s,string sub,int& offset,int& length,bool matchCase)
thank u very much for your support ! Regards, Neven Hi Neven, I did not understand your explanation where the problem is if you already have a linked module, why you still need to replicate this feature of DOORS, but to answer your question, you can use regular expressions with matches. See the DXL help or one of the many forum posts like e.g. Regexp dxl help for examples.
Regards, | ||||||||||